﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChongJu.ModelManager.DeviceInfo
{
    public class SerialPortModel
    {
        /// <summary>
        /// 模块名称
        /// </summary>
        public string ModuleName { get; set; }

        /// <summary>
        /// 模块类型
        /// </summary>
        public SerialType Type { get; set; }

        /// <summary>
        /// 串口名称
        /// </summary>
        public string PortName { get; set; }

        /// <summary>
        /// 波特率
        /// </summary>
        public int BaudRate { get; set; }

        /// <summary>
        /// 数据位
        /// </summary>
        public int DataBits { get; set; }

        /// <summary>
        /// 停止位
        /// </summary>
        public StopBits StopBits { get; set; }

        /// <summary>
        /// 校验位
        /// </summary>
        public Parity Parity { get; set; }
    }

    public enum SerialType
    {
        /// <summary>
        /// 前端称
        /// </summary>
        LeadWeigh = 1,

        /// <summary>
        /// 后端称
        /// </summary>
        AfterWeigh = 2,

        /// <summary>
        /// 光源控制钱
        /// </summary>
        LightSource = 3
    }
}
